|
The Command Set |
DEFDBL | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
DEFINT | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
DEFINTL | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
DEFSNG | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
DEFSTR | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
DEG | |
Type: | Command |
Syntax: | DEG |
Explanation: | Switches trigonometric functions to calculation by degree (0 to 360). Default setting is radian (0 to 2PI), see RAD. |
Example: |
DEG: PRINT SIN(45) |
Result: |
0.707106781186548 |
See also: | RAD |
DET | |
Type: | Function |
Syntax: | DET(<matrix name>([<num.expression>],[<num.expression>])) |
Explanation: | This function calculates the determinant of a quadratic matrix. The matrix must be available in the form of a two-dimensional floating point field. The size of the matrix must be specified for both dimensions. If the size specification is omitted, the maximum values used while dimensioning are applied automatically. |
Example: |
DATA 1.,2.,3.,4.,5.,6.,7.,8.,9. |
Result: |
0 |
DIM | |
Type: | Command |
Syntax: | DIM <variable>(<num.expression>[[,<num.expression]]) [[,<variable>(<num.expression>[[,<num.expression]])]] |
Explanation: | Dimensions one or several field variables. This requires that the numerical expressions be used to indicate their
maximum field sizes. The field may reach a maximal size of 2 gigabytes. Thus, there are no limits imposed on the number of the elements in the individual dimensions. The use of field variables is possible only after a DIM statement has been issued. After a definition, field sizes can only be modified with the following restrictions: If a dimension of a field other than the last one is modified, the field contents will shift. If the field is expanded further by one dimension, the field contents are lost. Note: The variable type flag (postfix %F) and byte (postfix %B) can only be employed as fields. |
Example: |
DIM A%(10),Flags%F(100),Value#(50,50) |
Result: |
The specified fields are dimensioned for their use later in the program. |
DMA_SOUND | |
Explanation: | Allocated for future applications! Please, do not use this word!! |
DPEEK |
|
Type: | Function |
Syntax: | DPEEK(<num.expression>) DPEEK(<address>) |
Explanation: | Reads a floating point number with double precision at the address resulting from the numerical expression. This command might be used, e.g., to import non-Omikron-Basic data structures into Omikron Basic floating point numbers. <Address> should be a number divisible by 8; otherwise, the function will be executed significantly slower. |
Example: |
Memory=MEMORY(10) |
Result: |
-3.14159265358979 |
See also: | PEEK WPEEK LPEEK SPEEK POKE WPOKE LPOKE SPOKE DPOKE |
DPOKE |
|
Type: | Command |
Syntax: | DPOKE <num.expression>,<num. expression> DPOKE <address>,<value> |
Explanation: | Posts the value at the indicated address in the form of a double float number. This means you can write floating point numbers directly to memory. This command is quite useful for the construction of one's own data structures with floating point numbers. <Address> should be a number divisible by 8; otherwise, the function will be carried out significantly slower. |
Example: | |
Result: | |
See also: | PEEK WPEEK LPEEK SPEEK DPEEK POKE WPOKE LPOKE SPOKE |
DRAW | |
Type: | Command |
Syntax: | DRAW [TO] <num.expression>,<num.expression>[[ TO <num.expression>,<num.expression>]]
DRAW [TO] <X>,<Y>[[ TO <Xn>,<Yn>]] |
Explanation: | Draws a quadratic point at the coordinate given by X and Y. A line is drawn starting at the current position of
the graphics pencil if TO has been indicated before this coordinate. Further coordinates separated by TO can be
indicated optionally and then connected with lines. Caution: The graphics pencil is changed by other drawing commands as well as by TEXT and PRINT. For this reason, DRAW TO X,Y commands must follow each other immediately. Under no circumstances may other graphics commands be inserted between them. Color, line style, and line width can be indicated using LINE COLOR, LINE STYLE, and LINE WIDTH respectively. If a window is defined by means of CLIP, nothing is drawn outside of this area. Instead of the square pen you can also use a rectangular one. Width and height of this drawing pen can be set with the procedure Set_Pen_Size from the Extension Library. Note: DRAW X,Y draws only one individual pixel, even if the set line width is larger than 1. Other line attributes are also not considered in this case. If larger points are to be drawn, which also take the set MODE into consideration, DRAW X,Y TO X,Y can be used. This behavior was introduced in order to be able to draw individual pixels with a simplified function as fast as possible. |
Example: |
DRAW 100,100 |
Result: |
Various points and lines are drawn onto the screen. |
See also: | POLYGON |
DUMP | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
EDIT | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. |
ELLIPSE | |
Type: | Command |
Syntax: | ELLIPSE <num.expression>,<num.expression>,<num.expression>, <num.expression>[,<num.expression>,<num.expression>]
ELLIPSE <X>,<Y>,<X radius>,<Y radius>[,<start angle>,<end angle>] |
Explanation: | Draws an ellipse around the center X,Y with the specified radii. Start and end angles can be indicated optionally
in one-tenth of a degree. Angle=0 is to the right of the center, angle=900 is above the center, etc. Color, line style, and line width can be determined using LINE COLOR, LINE STYLE, and LINE WIDTH respectively. If a window is defined by means of CLIP, nothing is drawn outside of this area. |
Example: | |
Result: | |
See also: | CIRCLE PELLIPSE PCIRCLE |
ELSE | |
Type: | Command |
Syntax: | ELSE |
Explanation: | This command is placed after an IF ... THEN ... structure and is executed exactly when the last IF ... THEN ... condition is not true, that is, if the last condition is false. |
Example: |
IF 0=1 |
Result: |
0 is not equal 1 |
See also: | IF THEN ENDIF |
END | |
Type: | Command |
Syntax: | END |
Explanation: | Concludes program execution and closes all files. |
Example: | |
Result: | |
See also: | CLEAR |
ENDIF | |
Type: | Command |
Syntax: | ENDIF |
Explanation: | ENDIF concludes the program branch that has been initiated with an IF statement. In the case of single-line structures such as IF ... THEN ... ELSE ... ENDIF, the ENDIF can also be omitted if no subsequent commands occur. |
Example: |
IF Count>Maximum THEN |
Result: | |
See also: | IF |
END_FN | |
Type: | Command |
Syntax: | END_FN |
Explanation: | END_FN is used to conclude a multi-line function definition. END_FN has precisely the same effect as RETURN; however, it cannot return any values. Nevertheless, END_FN should always be used at the end of a function. This clearly determines the location at which the function is concluded, especially if several RETURN statements are present. |
Example: |
PRINT FN Factorial(10) 'The function calls itself for as long as it takes to calculate the factorial (recursive programming). |
Result: |
3628800 |
See also: | DEF FN END_PROC RETURN |
END_PROC | |
Type: | Command |
Syntax: | END_PROC |
Explanation: | END_PROC is used to conclude a procedure definition. END_PROC approximately corresponds to the command RETURN, however, may be used exactly only once (namely at the end of the procedure). This clearly determines the location at which the procedure is concluded, especially if several RETURN statements are present. |
Example: |
DEF PROC Center(Text$) |
Result: |
Text$ is displayed centered on the screen. |
See also: | DEF PROC END_FN RETURN |
END_SELECT | |
Type: | Command |
Syntax: | END_SELECT |
Explanation: | Concludes a SELECT ... CASE statement. If all possible alternatives are listed, the SELECT statement is concluded with END_SELECT. |
Example: |
INPUT "Value 1-3: ";Value |
Result: |
Depending on the entered value, the corresponding text is displayed. |
EOF | |
Type: | Function |
Syntax: | EOF(<num.expression>) EOF(<file number>) |
Explanation: | Returns -1 (=true), if the end of the file is reached, otherwise 0 (=false). The file must be opened first with OPEN. |
Example: |
OPEN "I",1,FN Get_Fsspec$(0,0,"NEWOMBAS.INF") |
Result: |
Outputs the content of NEWOMBAS.INF as a character string. |
See also: | LOC LOF OPEN |
EQV | |
Type: | Operator |
Syntax: | <num.expression>EQV <num.expression> |
Explanation: | Links the two expressions with a logical operator bit-wise equivalently. |
Example: |
PRINT BIN$((%1010 EQV %1100)+%10000) |
Result: |
1001 |
ERL | |
Type: | Function |
Syntax: | ERL |
Explanation: | Always returns the number of the line in which the last error occurred. This function can be used after e.g., ON ERROR GOTO in order to determine the error line. |
Example: | |
Result: | |
See also: | ERR ERR$ ERROR |
ERR | |
Type: | Function |
Syntax: | ERR |
Explanation: | If an error occurs during the execution of the program, its number can be queried with ERR. Should an attempt be
made to e.g., open a file for reading that does not exist, this circumstance can be determined by querying the
function ERR immediately after the OPEN command. Note: Many BASIC commands reset ERR to 0. In order to catch a possible error, the query should be executed directly after the critical location and the error number saved into a variable for later use. |
Example: |
OPEN "I",1,FN Get_Fsspec$(0,0,"nonexistent") |
Result: |
File does not exist! |
See also: | ERL ERR$ ERROR |
ERR$ | |
Type: | Function |
Syntax: | ERR$ |
Explanation: | The function of ERR$ is identical to ERR, the only difference is that an error text is returned instead of a number. |
Example: | |
Result: | |
See also: | ERL ERR ERROR |
ERROR | |
Type: | Command |
Syntax: | ERROR(<num.expression>) ERROR(<error number>) |
Explanation: | Creates the error specified by the numerical expression. This command can be used to pass on those errors within an error-handling routine to BASIC, which the programmer does not want to handle him- or herself. This results in a corresponding error message issued by Omikron Basic. |
Example: |
ERROR 5 |
Result: |
Illegal function call in line no. 0 |
See also: | ERL ERR ERR$ Error Messages of Omikron Basic |
EXEC | |
Type: | Command |
Syntax: | EXEC <string expression>[,<string expression>] EXEC <file name>[,<HighLevelEvent>] |
Explanation: | Starts any executable program as a child process. <File name> must contain a FileSpecificationRecord. It is possible to pass a HighLevelEvent to the child process in the second string expression. As a result, you can immediately name this file, which means that the file will be opened immediately after the start of the child program. Further detailed information about the different event types can be found in "Inside Macintosh, Toolbox Essentials" and "Inside Macintosh, Interapplication Communication". |
Example: |
PRINT "Which program should be started?" |
Result: |
If the FILESELECT box was exited with 'Open', the selected program is started as a child process. |
EXIT | |
Type: | Command |
Syntax: | EXIT {[<num.expression>]|TO <label> EXIT {[<number of structures>]|TO <label> |
Explanation: | EXIT can be used to exit a structure prematurely - that is, a loop, a subprogram or a SELECT
... CASE. Execution of the program is continued directly after the end of the structure. Therefore, supplementary
termination/cancellation conditions can become part of a loop. For <number of structures>, Omikron Basic
6 can only specify 1 or -1. The value 1 functions identical to EXIT without parameters while in the latter case,
a procedure or function is exited without the global variables having been restored. Thus, they retain their allocated
local values. The stack is reset its initial value (as after start of program) as a result. For this reason, it
is only possible to use EXIT -1 to reach the main program from a subprogram, however, not from structures nested
repeatedly. If the program is not located in a structure, it is terminated completely. If another jump target is specified behind TO, the program does not continue directly after the end of the structure, but at the specified label. Yet, not more than one structure may be exited in this case as well. This means that the jump target has to be located in the next higher level. It is prohibited to exit from e.g., two loops at the same time using EXIT TO. Procedures and multi-line functions may not be exited with EXIT TO as well. |
Example: |
REPEAT |
Result: |
The value of Sum! is displayed on the screen. |
EXP | |
Type: | Function |
Syntax: | EXP(<num.expression>) |
Explanation: | Returns the value of the power of e (Euler's number) and the numerical expression. The reverse function is LN. |
Example: |
PRINT EXP(0) |
Result: |
1 |
See also: | SQR LN LOG |
EXPORT | |
Type: | Command |
Syntax: | EXPORT <statement>[[<,statement>]] |
Explanation: | This command may be used to determine which variables and functions are to be exported. The names of the statements to be exported are just separated by commas and listed behind the command. The command EXPORT is mainly required for the programming of shared libraries and plugins. |
Example: |
A=3 B#=1.2345 C$="Sample String" EXPORT A,B#,C$,FNEX Square#() DEF FNEX Square#(X#)=X#*X# |
Result: |
|
See also: | COMPILER "shlb" MAC_OS EXPORT_EXIT EXPORT_INIT EXPORT_MAIN DEF FNEX Sample program "SharedLib.BAS" in the DEMO folder. |
EXPORT_EXIT | |
Type: | Command |
Syntax: | EXPORT_EXIT <FNEX function> |
Explanation: | This command may be used to determine which function is supposed to serve as termination routine. This function is called automatically before the program ends. This command is especially important for the programming of shared libraries and plugins since in these cases one has no control over when the library ends. If the user ends the main program which uses your library, then the Code Fragment Manager will also remove all other libraries from memory, which are no longer required. However, first the termination function defined by EXPORT_EXIT is called so that your program has the opportunity to finish any still outstanding tasks (e.g., saving modified data). |
Example: |
EXPORT_EXIT FNEX Library_Exit ... 'Your Library Program ... DEF FNEX Library_Exit 'Your Termination Program Code END_FN |
Result: |
|
See also: | COMPILER "shlb" MAC_OS EXPORT EXPORT_INIT EXPORT_MAIN DEF FNEX Sample prorgam "SharedLib.BAS" in the DEMO folder. |
EXPORT_INIT | |
Type: | Command |
Syntax: | EXPORT_INIT <FNEX function> |
Explanation: | This command may be used to determine which function is supposed to serve as the initialization routine. This function is called automatically before the program is used for the first time. This command is especially important for the programming of shared libraries and plugins since in these cases one has no control over when the library is being used. If the user starts the main program, which also uses your Library, then the Code Fragment Manager also loads into memory all other Libraries needed by the main program. This is followed by the immediate call of the initialization function defined by EXPORT_INIT so that your program has the opportunity to execute all required initializations (e.g., dimensioning fields, initializing global variables, load files). |
Example: |
EXPORT_EXIT FNEX Library_Init ... 'Your Library Program ... DEF FNEX Library_Init 'Your Initialization Program Code END_FN |
Result: |
|
See also: | COMPILER "shlb" MAC_OS EXPORT EXPORT_EXIT EXPORT_MAIN DEF FNEX Sample program "SharedLib.BAS" in the DEMO folder. |
EXPORT_MAIN | |
Type: | Command |
Syntax: | EXPORT_MAIN <string constant> |
Explanation: | This command may be used to define a so-called main symbol. This command has no effect with normal applications
because in these cases the main symbol is always the entry point (transition vector to the beginning of the program
code). This command is significant for plugins because here information that is important for the main program
has to be placed into the main symbol (e.g., name of plugin, version number, etc.). The type of information to
be included in the main symbol can be requested from the creator of the main program for which you would like to
write a plugin. Note: The main symbol has to be a constant string because the information has to be already known at compilation time. |
Example: |
EXPORT_MAIN "SampleLibrary, Version 1.23" ... 'Your Library Program ... |
Result: |
|
See also: | COMPILER "shlb" MAC_OS EXPORT EXPORT_EXIT EXPORT_INIT DEF FNEX |
FACT | |
Type: | Function |
Syntax: | FACT(<num.expression>) |
Explanation: | Calculates the factorial of the numerical expression. Since calculation occurs via the gamma function (constant continuation of the factorial), floating point numbers may be specified as arguments as well. Negative integers return a NAN (Not A Number) as a result (pole). Positive numbers >170 return INF (+infinite). |
Example: |
PRINT FACT(10) |
Result: |
3628800 |
FIELD | |
Type: | Command |
Syntax: | FIELD [#]<num.expression>,<num.expression> [AS <string variable>] [[,<num.expression> [AS <string variable>]]] FIELD [#]<file number>,<sentence length> [AS <buffer variable>] [[,<sentence length> AS <buffer variable>]] |
Explanation: | Defines the data structure for the random access file indicated by the file number. The file must have been opened
previously using OPEN_"R." The length of the data set has to correspond
to the total sentence lengths of the FIELD commands. If the data structure is too extensive to be defined in one
line, then it is possible to divide it into two lines. A second FIELD statement can be used for this purpose, whereby
the first amount without buffer variable represents the sum of all already listed commands. After a read cycle using GET, the buffer variables receive the read data set. During a write cycle using PUT, the contents of the buffer variables are saved as a data set. Care has to be taken to ensure that the length of the buffer variables remains unchanged at all times. To achieve this goal, the field contents can be passed using LSET or RSET. Furthermore, only single strings are permitted as buffer variables; field elements are not permitted. Buffer variables for FIELD statements must never be used locally (LOCAL). They should really remain reserved exclusively for use as file buffers. |
Example: |
OPEN "R",1,FN Get_Fsspec$(0,0,"Addresses") |
Result: |
An address list is output to the printer. Of course, a file with the addresses has to have been created previously. |
See also: | OPEN GET PUT |
FILES | |
Explanation: | Has no application purpose in Omikron Basic 6 and is ignored by the compiler. Please, do not use. FILES: Note: If you want to extract directories you may use OPEN "F". |
FILESELECT or FSEL_INPUT | |
Type: | Command |
Syntax: | FILESELECT (<string variable>, <string variable>, <num.variable>) FILESELECT (<file type list|prompt|FileReplyRecord>,<default-name|prompt|Fsspec>, <R>) FSEL_INPUT (<string variable>, <string variable>, <num.variable>) FSEL_INPUT (<file type list|prompt|FileReplyRecord>,<default-name|prompt|Fsspec>, <R>) |
Explanation: | MacOS makes different file select boxes available for loading and saving. 1. R=0 : 'StandardGetFile' is called. In the first variable, a File Type list can be passed, which dictates the file types to be shown in the box. For example, "TEXTOBAS" would have the effect that all text files and all Omikron Basic program files are displayed. After exiting the box, a success flag is returned as R: R=1 indicates that the box has been exited using 'Open', R=0, that cancel was clicked on. The FileReplyRecord is returned in the first variable. Its exact structure can be traced in "Inside MacIntosh, Files". The FileSpecificationRecord returned in the second variable clearly determines the selected file and which must be passed e.g., in the case of OPEN. 2. R=1 : 'StandardPutFile' is called. A prompt can be passed in the first variable. This is a text indicated above the name field of the file. The desired name can be passed in the second variable. After exiting, R once again contains the success flag; the first variable the FileReplyRecord and the second the FileSpecificationRecord. Apple has introduced new file select boxes starting with System 8.5. These are now called File Navigation Services. If this operating system component is present, it will be automatically used instead of the old 'StandardGetFile' and 'StandardPutFile' functions. If the File Navigation Services are present then you may also pass a prompt in the second parameter when opening files. Additional values may be passed in <R> as well: R=2 : "NavChooseFile" is called. This is a file selection box, which does not contain a show menu and usually serves to select one file only. R=3 : "NavChooseVolume" is called. This dialog box may be used to prompt the user to choose a volume (drive). R=4 : "NavChooseFolder" is called. This may be applied to select a folder or volume. R=5 : "NavChooseObject" is called. This is the suitable dialog box if the user is supposed to have the option to choose any object (volume, folder, or file). R=6 : "NavNewFolder" is called. This dialog box serves the purpose of creating a new folder. If the File Navigation Services are present, you may pass another prompt in the second parameter when opening files. Caution: File Navigation Services do not function correctly if your program has no signature. Therefore, use the compiler control word COMPILER "SIGNATURE SIGN" to attach a signature to your program. The <FileReplyRecord> has a modified structure when the File Navigation Services are being used. Details about the structure of this data type are explained in "Inside Macintosh, Programming with Navigation Services." Note: A non-movable file selection box, which cannot be altered in size, will be created anyway. If you wish extended capabilities you can use the EasyGem Library version 3.10 or higher. |
Example: |
'The Extension Library has to be loaded before using the menu option 'Merge LIBRARY'. |
Result: |
The program ask you to select a file and then displays the name, the FileType, the VolumeReferenceNumber and the DirectoryIdentificationNumber on the screen. The program quits, if the fileselect box is closed with 'Cancel'. |
See also: | Program "FILESELECT.BAS" in the DEMO folder. |
FILL | |
Type: | Command |
Syntax: | FILL <num.Ausdruck>,<num.Ausdruck>,<num.Ausdruck> FILL <X>,<Y>,<outline color> |
Explanation: | Fills an area starting from a seed point at the coordinates <X> and <Y>. Every point containing the
outline color is interpreted as the outer limit of the area. In the case of <outline color>=-1, all pixels
function as a boundary which do not match exactly the color at the seed point (<X>,<Y>). If <X> = -1, all fields enclosed by the outline color are filled as well as individual points and lines in the outline
color. If <Y> = -1 is set as well, the fill process is inverted, that is, the area outside of the fields
enclosed by <outline color> is now filled. The fill color and fill pattern defined by FILL COLOR and FILL STYLE respectively, is used for the fill process. The commands PBOX, PRBOX, PCIRCLE, PELLIPSE, and PPOLYGON fill an area considerably faster than the corresponding drawing commands with a subsequent FILL and are therefore to be used preferably if possible. If a window is defined by means of CLIP, nothing is filled outside of this area. |
Example: |
LINE COLOR =1:LINE WIDTH =5:LINE STYLE =1 |
Result: |
Using the three basic colors the additive color mix is displayed. |
See also: |
FILL COLOR | |
Type: | Command |
Syntax: | FILL COLOR=<num.expression> |
Explanation: | The numerical value is an index to the internal color map (CLUT) of Omikron Basic. The actual red, green, and blue proportions can be derived from the description in 'Internal Color Map of Omikron Basic' in the appendix. |
Example: | |
Result: | |
See also: | FILL FILL PATTERN FILL STYLE PALETTE Internal Color Map of Omikron Basic |
FILL PATTERN | |
Type: | Command |
Syntax: | FILL PATTERN = <num.expression>,<num.expression> FILL PATTERN =<fill pattern>,<fill pattern> |
Explanation: | The numerical expressions have to pass long integer numbers. An 8 x 8 bit pattern is created from the total sum
of the 64 bits of the two numbers, which serves as the fill pattern for areas, if FILL STYLE= 0,0 is indicated.
Every set bit triggers the foreground color; every unset bit the background color. Tip: Because leading zeros are not displayed by the editor and binary numbers with a set bit in the highest digit are interpreted as negative numbers, it is sometimes hardly to see which bits are set in the pattern and which are not. To avoid this problems, you can use strings instead of numbers to define your patterns. Note: Colored fill patterns cannot be defined this way. However, it is possible to use a resource editor (e.g., ResEdit by Apple) and generate customized, colored fill patterns. |
Example: |
FILL PATTERN= %00110011110011000011001111001100, %00110011110011000011001111001100 |
Result: |
Two screened rectangles are drawn. |
See also: | FILL FILL COLOR FILL STYLE LINE PATTERN |
FILL STYLE | |
Type: | Command |
Syntax: | FILL STYLE=<num.expression>,<num.expression> FILL STYLE=<fill style>,<fill style> |
Explanation: | Selects the fill style to be used with fill commands. The following can be selected using <fill style>: 0: Do not fill 1: Fill completely 2: Dot pattern 3: Line type 4: Colored fill patterns If FILL STYLE= 0,0, the fill pattern defined with FILL PATTERN is used. For the possible values which can be passed here, have a look on the fill style table in chapter 7. Note: The several fill style groups are all arranged in line. So, if you pass a number greater than the highest element of one group you will get a pattern taken from the next following group. For instance FILL STYLE = 2,25 will lead to the same result as FILL STYLE = 3,1. |
Example: | |
Result: | |
See also: | FILL FILL COLOR FILL PATTERN Fill style table |
FIX | |
Type: | Command |
Syntax: | FIX(<num.expression>) |
Explanation: | Rounds off the numerical value to an integer. Unlike INT, numbers in the negative range are also rounded off. FIX is the counterpart to FRAC. |
Example: |
PRINT FIX( PI ) |
Result: |
3 |
See also: | INT FRAC |
Tech-Support | Order | Start | Home: http://www.berkhan.com |
© 1997-1999 ![]() |